package kr.hkit.powerjava.chapter22.a;

public class OrderedPair<K, V> implements Pair<K, V> {
	private K key;
	private V value;

	public OrderedPair(K key, V value) {
		this.key = key;
		this.value = value;
	}

	@Override
	public String toString() {
		return String.format("OrderedPair [key=%s, value=%s]", key, value);
	}

	@Override
	public K getKey() {
		return key;
	}

	@Override
	public V getValue() {
		return value;
	}

	public static void main(String[] args) {
		Pair p1 = new OrderedPair<String, Integer>("Even", 8);
		Pair p2 = new OrderedPair<String, String>("Hello", "World");

		System.out.println(p1);
		System.out.println(p2);
	}

}